-
Notifications
You must be signed in to change notification settings - Fork 0
SQL Format Support ON CONFLICT #293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQL Format Support ON CONFLICT #293
Conversation
0ee229d to
19261b7
Compare
19261b7 to
7be9abb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces enhanced formatting support for SQL upsert statements using the ON CONFLICT clause. The updates include new test cases for various ON CONFLICT patterns, modifications to how conflict and DO clauses are handled in formatter block utilities, and minor refactoring in test configuration for consistent file naming.
Reviewed Changes
Copilot reviewed 34 out of 38 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/test/testData/sql/formatter/InsertConflictUpdate*.sql | Added/updated tests to verify proper formatting of INSERT statements with ON CONFLICT clauses. |
| src/test/kotlin/org/domaframework/doma/intellij/formatter/SqlFormatterTest.kt | Updated test naming using a new formatDataPrefix variable for consistency. |
| src/main/kotlin/org/domaframework/doma/intellij/formatter/util/SqlBlockUtil.kt | Introduced and refined formatting handling for conflict-related blocks (e.g. CONFLICT, DO, etc.). |
| Other Kotlin formatter and block files | Various adjustments and import refactorings to support new conflict clause support in SQL formatting. |
Comments suppressed due to low confidence (2)
src/test/kotlin/org/domaframework/doma/intellij/formatter/SqlFormatterTest.kt:30
- [nitpick] Consider adding a brief inline comment explaining the purpose of the formatDataPrefix variable to clarify its role in constructing expected test filenames.
private val formatDataPrefix = "_format"
src/main/kotlin/org/domaframework/doma/intellij/formatter/block/group/keyword/update/SqlUpdateValueGroupBlock.kt:52
- [nitpick] Consider expanding or updating this TODO comment to indicate a plan for creating a dedicated class for update values to improve clarity and maintainability.
// TODO Update Values用のクラスを作る
src/main/kotlin/org/domaframework/doma/intellij/formatter/util/SqlBlockUtil.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
51821f2 to
03edac5
Compare
Support formatting for upsert statements using the
ON CONFLICT DO [NOTHING | UPDATE]syntax.This includes proper indentation and line breaking rules for
ON CONFLICT, optionalON CONSTRAINT, and theDOclause with its associated update logic.